package b.g.b.h.l;

import b.g.b.h.d;
import b.g.b.h.e;
import c.b.a.a.a;
import java.util.ArrayList;
import java.util.Iterator;

/* compiled from: ChainRun */
public class c extends o {
    public ArrayList<o> k = new ArrayList();
    public int l;

    public c(d dVar, int i) {
        int i2;
        super(dVar);
        this.f = i;
        dVar = this.b;
        d o = dVar.o(i);
        while (true) {
            d dVar2 = o;
            o = dVar;
            dVar = dVar2;
            if (dVar == null) {
                break;
            }
            o = dVar.o(this.f);
        }
        this.b = o;
        ArrayList arrayList = this.k;
        int i3 = this.f;
        Object obj = i3 == 0 ? o.d : i3 == 1 ? o.e : null;
        arrayList.add(obj);
        dVar = o.n(this.f);
        while (dVar != null) {
            ArrayList arrayList2 = this.k;
            i3 = this.f;
            obj = i3 == 0 ? dVar.d : i3 == 1 ? dVar.e : null;
            arrayList2.add(obj);
            dVar = dVar.n(this.f);
        }
        Iterator it = this.k.iterator();
        while (it.hasNext()) {
            o oVar = (o) it.next();
            i3 = this.f;
            if (i3 == 0) {
                oVar.b.b = this;
            } else if (i3 == 1) {
                oVar.b.c = this;
            }
        }
        Object obj2 = (this.f == 0 && ((e) this.b.P).p0) ? 1 : null;
        if (obj2 != null && this.k.size() > 1) {
            arrayList = this.k;
            this.b = ((o) arrayList.get(arrayList.size() - 1)).b;
        }
        if (this.f == 0) {
            i2 = this.b.e0;
        } else {
            i2 = this.b.f0;
        }
        this.l = i2;
    }

    /* JADX WARNING: Removed duplicated region for block: B:63:0x00dd  */
    /* JADX WARNING: Removed duplicated region for block: B:60:0x00cd  */
    public void a(b.g.b.h.l.d r27) {
        /*
        r26 = this;
        r0 = r26;
        r1 = b.g.b.h.d.a.MATCH_CONSTRAINT;
        r2 = r0.h;
        r3 = r2.j;
        if (r3 == 0) goto L_0x041b;
    L_0x000a:
        r3 = r0.i;
        r4 = r3.j;
        if (r4 != 0) goto L_0x0012;
    L_0x0010:
        goto L_0x041b;
    L_0x0012:
        r4 = r0.b;
        r4 = r4.P;
        if (r4 == 0) goto L_0x0021;
    L_0x0018:
        r6 = r4 instanceof b.g.b.h.e;
        if (r6 == 0) goto L_0x0021;
    L_0x001c:
        r4 = (b.g.b.h.e) r4;
        r4 = r4.p0;
        goto L_0x0022;
    L_0x0021:
        r4 = 0;
    L_0x0022:
        r3 = r3.g;
        r2 = r2.g;
        r3 = r3 - r2;
        r2 = r0.k;
        r2 = r2.size();
        r6 = 0;
    L_0x002e:
        r7 = -1;
        r8 = 8;
        if (r6 >= r2) goto L_0x0044;
    L_0x0033:
        r9 = r0.k;
        r9 = r9.get(r6);
        r9 = (b.g.b.h.l.o) r9;
        r9 = r9.b;
        r9 = r9.c0;
        if (r9 != r8) goto L_0x0045;
    L_0x0041:
        r6 = r6 + 1;
        goto L_0x002e;
    L_0x0044:
        r6 = -1;
    L_0x0045:
        r9 = r2 + -1;
        r10 = r9;
    L_0x0048:
        if (r10 < 0) goto L_0x005c;
    L_0x004a:
        r11 = r0.k;
        r11 = r11.get(r10);
        r11 = (b.g.b.h.l.o) r11;
        r11 = r11.b;
        r11 = r11.c0;
        if (r11 != r8) goto L_0x005b;
    L_0x0058:
        r10 = r10 + -1;
        goto L_0x0048;
    L_0x005b:
        r7 = r10;
    L_0x005c:
        r10 = 0;
    L_0x005d:
        r12 = 2;
        if (r10 >= r12) goto L_0x00ff;
    L_0x0060:
        r14 = 0;
        r15 = 0;
        r16 = 0;
        r17 = 0;
        r18 = 0;
    L_0x0068:
        if (r14 >= r2) goto L_0x00ef;
    L_0x006a:
        r5 = r0.k;
        r5 = r5.get(r14);
        r5 = (b.g.b.h.l.o) r5;
        r12 = r5.b;
        r11 = r12.c0;
        if (r11 != r8) goto L_0x007a;
    L_0x0078:
        goto L_0x00e8;
    L_0x007a:
        r17 = r17 + 1;
        if (r14 <= 0) goto L_0x0085;
    L_0x007e:
        if (r14 < r6) goto L_0x0085;
    L_0x0080:
        r11 = r5.h;
        r11 = r11.f;
        r15 = r15 + r11;
    L_0x0085:
        r11 = r5.e;
        r8 = r11.g;
        r13 = r5.d;
        if (r13 == r1) goto L_0x008f;
    L_0x008d:
        r13 = 1;
        goto L_0x0090;
    L_0x008f:
        r13 = 0;
    L_0x0090:
        if (r13 == 0) goto L_0x00b0;
    L_0x0092:
        r11 = r0.f;
        r20 = r8;
        if (r11 != 0) goto L_0x00a1;
    L_0x0098:
        r8 = r12.d;
        r8 = r8.e;
        r8 = r8.j;
        if (r8 != 0) goto L_0x00a1;
    L_0x00a0:
        return;
    L_0x00a1:
        r8 = 1;
        if (r11 != r8) goto L_0x00ad;
    L_0x00a4:
        r11 = r12.e;
        r11 = r11.e;
        r11 = r11.j;
        if (r11 != 0) goto L_0x00ad;
    L_0x00ac:
        return;
    L_0x00ad:
        r21 = r13;
        goto L_0x00c9;
    L_0x00b0:
        r20 = r8;
        r21 = r13;
        r8 = 1;
        r13 = r5.a;
        if (r13 != r8) goto L_0x00c0;
    L_0x00b9:
        if (r10 != 0) goto L_0x00c0;
    L_0x00bb:
        r8 = r11.m;
        r16 = r16 + 1;
        goto L_0x00c6;
    L_0x00c0:
        r8 = r11.j;
        if (r8 == 0) goto L_0x00c9;
    L_0x00c4:
        r8 = r20;
    L_0x00c6:
        r21 = 1;
        goto L_0x00cb;
    L_0x00c9:
        r8 = r20;
    L_0x00cb:
        if (r21 != 0) goto L_0x00dd;
    L_0x00cd:
        r16 = r16 + 1;
        r8 = r12.g0;
        r11 = r0.f;
        r8 = r8[r11];
        r11 = 0;
        r12 = (r8 > r11 ? 1 : (r8 == r11 ? 0 : -1));
        if (r12 < 0) goto L_0x00de;
    L_0x00da:
        r18 = r18 + r8;
        goto L_0x00de;
    L_0x00dd:
        r15 = r15 + r8;
    L_0x00de:
        if (r14 >= r9) goto L_0x00e8;
    L_0x00e0:
        if (r14 >= r7) goto L_0x00e8;
    L_0x00e2:
        r5 = r5.i;
        r5 = r5.f;
        r5 = -r5;
        r15 = r15 + r5;
    L_0x00e8:
        r14 = r14 + 1;
        r8 = 8;
        r12 = 2;
        goto L_0x0068;
    L_0x00ef:
        if (r15 < r3) goto L_0x00fa;
    L_0x00f1:
        if (r16 != 0) goto L_0x00f4;
    L_0x00f3:
        goto L_0x00fa;
    L_0x00f4:
        r10 = r10 + 1;
        r8 = 8;
        goto L_0x005d;
    L_0x00fa:
        r5 = r16;
        r8 = r17;
        goto L_0x0104;
    L_0x00ff:
        r5 = 0;
        r8 = 0;
        r15 = 0;
        r18 = 0;
    L_0x0104:
        r10 = r0.h;
        r10 = r10.g;
        if (r4 == 0) goto L_0x010e;
    L_0x010a:
        r10 = r0.i;
        r10 = r10.g;
    L_0x010e:
        r11 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;
        if (r15 <= r3) goto L_0x0125;
    L_0x0112:
        r12 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        if (r4 == 0) goto L_0x011e;
    L_0x0116:
        r13 = r15 - r3;
        r13 = (float) r13;
        r13 = r13 / r12;
        r13 = r13 + r11;
        r12 = (int) r13;
        r10 = r10 + r12;
        goto L_0x0125;
    L_0x011e:
        r13 = r15 - r3;
        r13 = (float) r13;
        r13 = r13 / r12;
        r13 = r13 + r11;
        r12 = (int) r13;
        r10 = r10 - r12;
    L_0x0125:
        if (r5 <= 0) goto L_0x0228;
    L_0x0127:
        r12 = r3 - r15;
        r12 = (float) r12;
        r13 = (float) r5;
        r13 = r12 / r13;
        r13 = r13 + r11;
        r13 = (int) r13;
        r14 = 0;
        r16 = 0;
    L_0x0132:
        if (r14 >= r2) goto L_0x01db;
    L_0x0134:
        r11 = r0.k;
        r11 = r11.get(r14);
        r11 = (b.g.b.h.l.o) r11;
        r20 = r13;
        r13 = r11.b;
        r21 = r15;
        r15 = r13.c0;
        r22 = r10;
        r10 = 8;
        if (r15 != r10) goto L_0x014c;
    L_0x014a:
        goto L_0x01c3;
    L_0x014c:
        r10 = r11.d;
        if (r10 != r1) goto L_0x01c3;
    L_0x0150:
        r10 = r11.e;
        r15 = r10.j;
        if (r15 != 0) goto L_0x01c3;
    L_0x0156:
        r15 = 0;
        r19 = (r18 > r15 ? 1 : (r18 == r15 ? 0 : -1));
        if (r19 <= 0) goto L_0x016c;
    L_0x015b:
        r15 = r13.g0;
        r23 = r1;
        r1 = r0.f;
        r1 = r15[r1];
        r1 = r1 * r12;
        r1 = r1 / r18;
        r15 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;
        r1 = r1 + r15;
        r1 = (int) r1;
        goto L_0x0170;
    L_0x016c:
        r23 = r1;
        r1 = r20;
    L_0x0170:
        r15 = r0.f;
        if (r15 != 0) goto L_0x0199;
    L_0x0174:
        r15 = r13.p;
        r13 = r13.o;
        r24 = r12;
        r12 = r11.a;
        r25 = r4;
        r4 = 1;
        if (r12 != r4) goto L_0x0188;
    L_0x0181:
        r4 = r10.m;
        r4 = java.lang.Math.min(r1, r4);
        goto L_0x0189;
    L_0x0188:
        r4 = r1;
    L_0x0189:
        r4 = java.lang.Math.max(r13, r4);
        if (r15 <= 0) goto L_0x0193;
    L_0x018f:
        r4 = java.lang.Math.min(r15, r4);
    L_0x0193:
        if (r4 == r1) goto L_0x01bd;
    L_0x0195:
        r16 = r16 + 1;
        r1 = r4;
        goto L_0x01bd;
    L_0x0199:
        r25 = r4;
        r24 = r12;
        r4 = r13.s;
        r12 = r13.r;
        r13 = r11.a;
        r15 = 1;
        if (r13 != r15) goto L_0x01ad;
    L_0x01a6:
        r10 = r10.m;
        r10 = java.lang.Math.min(r1, r10);
        goto L_0x01ae;
    L_0x01ad:
        r10 = r1;
    L_0x01ae:
        r10 = java.lang.Math.max(r12, r10);
        if (r4 <= 0) goto L_0x01b8;
    L_0x01b4:
        r10 = java.lang.Math.min(r4, r10);
    L_0x01b8:
        if (r10 == r1) goto L_0x01bd;
    L_0x01ba:
        r16 = r16 + 1;
        r1 = r10;
    L_0x01bd:
        r4 = r11.e;
        r4.c(r1);
        goto L_0x01c9;
    L_0x01c3:
        r23 = r1;
        r25 = r4;
        r24 = r12;
    L_0x01c9:
        r14 = r14 + 1;
        r13 = r20;
        r15 = r21;
        r10 = r22;
        r1 = r23;
        r12 = r24;
        r4 = r25;
        r11 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;
        goto L_0x0132;
    L_0x01db:
        r23 = r1;
        r25 = r4;
        r22 = r10;
        r21 = r15;
        if (r16 <= 0) goto L_0x0219;
    L_0x01e5:
        r5 = r5 - r16;
        r1 = 0;
        r4 = 0;
    L_0x01e9:
        if (r1 >= r2) goto L_0x0217;
    L_0x01eb:
        r10 = r0.k;
        r10 = r10.get(r1);
        r10 = (b.g.b.h.l.o) r10;
        r11 = r10.b;
        r11 = r11.c0;
        r12 = 8;
        if (r11 != r12) goto L_0x01fc;
    L_0x01fb:
        goto L_0x0214;
    L_0x01fc:
        if (r1 <= 0) goto L_0x0205;
    L_0x01fe:
        if (r1 < r6) goto L_0x0205;
    L_0x0200:
        r11 = r10.h;
        r11 = r11.f;
        r4 = r4 + r11;
    L_0x0205:
        r11 = r10.e;
        r11 = r11.g;
        r4 = r4 + r11;
        if (r1 >= r9) goto L_0x0214;
    L_0x020c:
        if (r1 >= r7) goto L_0x0214;
    L_0x020e:
        r10 = r10.i;
        r10 = r10.f;
        r10 = -r10;
        r4 = r4 + r10;
    L_0x0214:
        r1 = r1 + 1;
        goto L_0x01e9;
    L_0x0217:
        r15 = r4;
        goto L_0x021b;
    L_0x0219:
        r15 = r21;
    L_0x021b:
        r1 = r0.l;
        r4 = 2;
        if (r1 != r4) goto L_0x0226;
    L_0x0220:
        if (r16 != 0) goto L_0x0226;
    L_0x0222:
        r1 = 0;
        r0.l = r1;
        goto L_0x0232;
    L_0x0226:
        r1 = 0;
        goto L_0x0232;
    L_0x0228:
        r23 = r1;
        r25 = r4;
        r22 = r10;
        r21 = r15;
        r1 = 0;
        r4 = 2;
    L_0x0232:
        if (r15 <= r3) goto L_0x0236;
    L_0x0234:
        r0.l = r4;
    L_0x0236:
        if (r8 <= 0) goto L_0x023e;
    L_0x0238:
        if (r5 != 0) goto L_0x023e;
    L_0x023a:
        if (r6 != r7) goto L_0x023e;
    L_0x023c:
        r0.l = r4;
    L_0x023e:
        r4 = r0.l;
        r10 = 1;
        if (r4 != r10) goto L_0x02e1;
    L_0x0243:
        if (r8 <= r10) goto L_0x0249;
    L_0x0245:
        r3 = r3 - r15;
        r8 = r8 - r10;
        r3 = r3 / r8;
        goto L_0x0250;
    L_0x0249:
        if (r8 != r10) goto L_0x024f;
    L_0x024b:
        r3 = r3 - r15;
        r4 = 2;
        r3 = r3 / r4;
        goto L_0x0250;
    L_0x024f:
        r3 = 0;
    L_0x0250:
        if (r5 <= 0) goto L_0x0253;
    L_0x0252:
        r3 = 0;
    L_0x0253:
        r10 = r22;
        r5 = 0;
    L_0x0256:
        if (r5 >= r2) goto L_0x041b;
    L_0x0258:
        if (r25 == 0) goto L_0x025f;
    L_0x025a:
        r1 = r5 + 1;
        r1 = r2 - r1;
        goto L_0x0260;
    L_0x025f:
        r1 = r5;
    L_0x0260:
        r4 = r0.k;
        r1 = r4.get(r1);
        r1 = (b.g.b.h.l.o) r1;
        r4 = r1.b;
        r4 = r4.c0;
        r8 = 8;
        if (r4 != r8) goto L_0x027d;
    L_0x0270:
        r4 = r1.h;
        r4.c(r10);
        r1 = r1.i;
        r1.c(r10);
        r12 = r23;
        goto L_0x02db;
    L_0x027d:
        if (r5 <= 0) goto L_0x0284;
    L_0x027f:
        if (r25 == 0) goto L_0x0283;
    L_0x0281:
        r10 = r10 - r3;
        goto L_0x0284;
    L_0x0283:
        r10 = r10 + r3;
    L_0x0284:
        if (r5 <= 0) goto L_0x0295;
    L_0x0286:
        if (r5 < r6) goto L_0x0295;
    L_0x0288:
        if (r25 == 0) goto L_0x0290;
    L_0x028a:
        r4 = r1.h;
        r4 = r4.f;
        r10 = r10 - r4;
        goto L_0x0295;
    L_0x0290:
        r4 = r1.h;
        r4 = r4.f;
        r10 = r10 + r4;
    L_0x0295:
        if (r25 == 0) goto L_0x029d;
    L_0x0297:
        r4 = r1.i;
        r4.c(r10);
        goto L_0x02a2;
    L_0x029d:
        r4 = r1.h;
        r4.c(r10);
    L_0x02a2:
        r4 = r1.e;
        r8 = r4.g;
        r11 = r1.d;
        r12 = r23;
        if (r11 != r12) goto L_0x02b3;
    L_0x02ac:
        r11 = r1.a;
        r13 = 1;
        if (r11 != r13) goto L_0x02b3;
    L_0x02b1:
        r8 = r4.m;
    L_0x02b3:
        if (r25 == 0) goto L_0x02b7;
    L_0x02b5:
        r10 = r10 - r8;
        goto L_0x02b8;
    L_0x02b7:
        r10 = r10 + r8;
    L_0x02b8:
        if (r25 == 0) goto L_0x02c0;
    L_0x02ba:
        r4 = r1.h;
        r4.c(r10);
        goto L_0x02c5;
    L_0x02c0:
        r4 = r1.i;
        r4.c(r10);
    L_0x02c5:
        r4 = 1;
        r1.g = r4;
        if (r5 >= r9) goto L_0x02db;
    L_0x02ca:
        if (r5 >= r7) goto L_0x02db;
    L_0x02cc:
        if (r25 == 0) goto L_0x02d5;
    L_0x02ce:
        r1 = r1.i;
        r1 = r1.f;
        r1 = -r1;
        r10 = r10 - r1;
        goto L_0x02db;
    L_0x02d5:
        r1 = r1.i;
        r1 = r1.f;
        r1 = -r1;
        r10 = r10 + r1;
    L_0x02db:
        r5 = r5 + 1;
        r23 = r12;
        goto L_0x0256;
    L_0x02e1:
        r12 = r23;
        if (r4 != 0) goto L_0x0373;
    L_0x02e5:
        r3 = r3 - r15;
        r4 = 1;
        r8 = r8 + r4;
        r3 = r3 / r8;
        if (r5 <= 0) goto L_0x02ec;
    L_0x02eb:
        r3 = 0;
    L_0x02ec:
        r10 = r22;
        r5 = 0;
    L_0x02ef:
        if (r5 >= r2) goto L_0x041b;
    L_0x02f1:
        if (r25 == 0) goto L_0x02f8;
    L_0x02f3:
        r1 = r5 + 1;
        r1 = r2 - r1;
        goto L_0x02f9;
    L_0x02f8:
        r1 = r5;
    L_0x02f9:
        r4 = r0.k;
        r1 = r4.get(r1);
        r1 = (b.g.b.h.l.o) r1;
        r4 = r1.b;
        r4 = r4.c0;
        r8 = 8;
        if (r4 != r8) goto L_0x0314;
    L_0x0309:
        r4 = r1.h;
        r4.c(r10);
        r1 = r1.i;
        r1.c(r10);
        goto L_0x036f;
    L_0x0314:
        if (r25 == 0) goto L_0x0318;
    L_0x0316:
        r10 = r10 - r3;
        goto L_0x0319;
    L_0x0318:
        r10 = r10 + r3;
    L_0x0319:
        if (r5 <= 0) goto L_0x032a;
    L_0x031b:
        if (r5 < r6) goto L_0x032a;
    L_0x031d:
        if (r25 == 0) goto L_0x0325;
    L_0x031f:
        r4 = r1.h;
        r4 = r4.f;
        r10 = r10 - r4;
        goto L_0x032a;
    L_0x0325:
        r4 = r1.h;
        r4 = r4.f;
        r10 = r10 + r4;
    L_0x032a:
        if (r25 == 0) goto L_0x0332;
    L_0x032c:
        r4 = r1.i;
        r4.c(r10);
        goto L_0x0337;
    L_0x0332:
        r4 = r1.h;
        r4.c(r10);
    L_0x0337:
        r4 = r1.e;
        r8 = r4.g;
        r11 = r1.d;
        if (r11 != r12) goto L_0x034a;
    L_0x033f:
        r11 = r1.a;
        r13 = 1;
        if (r11 != r13) goto L_0x034a;
    L_0x0344:
        r4 = r4.m;
        r8 = java.lang.Math.min(r8, r4);
    L_0x034a:
        if (r25 == 0) goto L_0x034e;
    L_0x034c:
        r10 = r10 - r8;
        goto L_0x034f;
    L_0x034e:
        r10 = r10 + r8;
    L_0x034f:
        if (r25 == 0) goto L_0x0357;
    L_0x0351:
        r4 = r1.h;
        r4.c(r10);
        goto L_0x035c;
    L_0x0357:
        r4 = r1.i;
        r4.c(r10);
    L_0x035c:
        if (r5 >= r9) goto L_0x036f;
    L_0x035e:
        if (r5 >= r7) goto L_0x036f;
    L_0x0360:
        if (r25 == 0) goto L_0x0369;
    L_0x0362:
        r1 = r1.i;
        r1 = r1.f;
        r1 = -r1;
        r10 = r10 - r1;
        goto L_0x036f;
    L_0x0369:
        r1 = r1.i;
        r1 = r1.f;
        r1 = -r1;
        r10 = r10 + r1;
    L_0x036f:
        r5 = r5 + 1;
        goto L_0x02ef;
    L_0x0373:
        r8 = 2;
        if (r4 != r8) goto L_0x041b;
    L_0x0376:
        r4 = r0.f;
        if (r4 != 0) goto L_0x037f;
    L_0x037a:
        r4 = r0.b;
        r4 = r4.Z;
        goto L_0x0383;
    L_0x037f:
        r4 = r0.b;
        r4 = r4.a0;
    L_0x0383:
        if (r25 == 0) goto L_0x0389;
    L_0x0385:
        r8 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
        r4 = r8 - r4;
    L_0x0389:
        r3 = r3 - r15;
        r3 = (float) r3;
        r3 = r3 * r4;
        r4 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;
        r3 = r3 + r4;
        r3 = (int) r3;
        if (r3 < 0) goto L_0x0395;
    L_0x0393:
        if (r5 <= 0) goto L_0x0396;
    L_0x0395:
        r3 = 0;
    L_0x0396:
        if (r25 == 0) goto L_0x039b;
    L_0x0398:
        r10 = r22 - r3;
        goto L_0x039d;
    L_0x039b:
        r10 = r22 + r3;
    L_0x039d:
        r5 = 0;
    L_0x039e:
        if (r5 >= r2) goto L_0x041b;
    L_0x03a0:
        if (r25 == 0) goto L_0x03a7;
    L_0x03a2:
        r1 = r5 + 1;
        r1 = r2 - r1;
        goto L_0x03a8;
    L_0x03a7:
        r1 = r5;
    L_0x03a8:
        r3 = r0.k;
        r1 = r3.get(r1);
        r1 = (b.g.b.h.l.o) r1;
        r3 = r1.b;
        r3 = r3.c0;
        r4 = 8;
        if (r3 != r4) goto L_0x03c4;
    L_0x03b8:
        r3 = r1.h;
        r3.c(r10);
        r1 = r1.i;
        r1.c(r10);
        r13 = 1;
        goto L_0x0418;
    L_0x03c4:
        if (r5 <= 0) goto L_0x03d5;
    L_0x03c6:
        if (r5 < r6) goto L_0x03d5;
    L_0x03c8:
        if (r25 == 0) goto L_0x03d0;
    L_0x03ca:
        r3 = r1.h;
        r3 = r3.f;
        r10 = r10 - r3;
        goto L_0x03d5;
    L_0x03d0:
        r3 = r1.h;
        r3 = r3.f;
        r10 = r10 + r3;
    L_0x03d5:
        if (r25 == 0) goto L_0x03dd;
    L_0x03d7:
        r3 = r1.i;
        r3.c(r10);
        goto L_0x03e2;
    L_0x03dd:
        r3 = r1.h;
        r3.c(r10);
    L_0x03e2:
        r3 = r1.e;
        r8 = r3.g;
        r11 = r1.d;
        if (r11 != r12) goto L_0x03f2;
    L_0x03ea:
        r11 = r1.a;
        r13 = 1;
        if (r11 != r13) goto L_0x03f3;
    L_0x03ef:
        r8 = r3.m;
        goto L_0x03f3;
    L_0x03f2:
        r13 = 1;
    L_0x03f3:
        if (r25 == 0) goto L_0x03f7;
    L_0x03f5:
        r10 = r10 - r8;
        goto L_0x03f8;
    L_0x03f7:
        r10 = r10 + r8;
    L_0x03f8:
        if (r25 == 0) goto L_0x0400;
    L_0x03fa:
        r3 = r1.h;
        r3.c(r10);
        goto L_0x0405;
    L_0x0400:
        r3 = r1.i;
        r3.c(r10);
    L_0x0405:
        if (r5 >= r9) goto L_0x0418;
    L_0x0407:
        if (r5 >= r7) goto L_0x0418;
    L_0x0409:
        if (r25 == 0) goto L_0x0412;
    L_0x040b:
        r1 = r1.i;
        r1 = r1.f;
        r1 = -r1;
        r10 = r10 - r1;
        goto L_0x0418;
    L_0x0412:
        r1 = r1.i;
        r1 = r1.f;
        r1 = -r1;
        r10 = r10 + r1;
    L_0x0418:
        r5 = r5 + 1;
        goto L_0x039e;
    L_0x041b:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.g.b.h.l.c.a(b.g.b.h.l.d):void");
    }

    public void d() {
        Iterator it = this.k.iterator();
        while (it.hasNext()) {
            ((o) it.next()).d();
        }
        int size = this.k.size();
        if (size >= 1) {
            d dVar = ((o) this.k.get(0)).b;
            d dVar2 = ((o) this.k.get(size - 1)).b;
            b.g.b.h.c cVar;
            f i;
            d m;
            f fVar;
            f i2;
            if (this.f == 0) {
                b.g.b.h.c cVar2 = dVar.D;
                cVar = dVar2.F;
                i = i(cVar2, 0);
                int d = cVar2.d();
                m = m();
                if (m != null) {
                    d = m.D.d();
                }
                if (i != null) {
                    fVar = this.h;
                    fVar.l.add(i);
                    fVar.f = d;
                    i.k.add(fVar);
                }
                i2 = i(cVar, 0);
                size = cVar.d();
                dVar = n();
                if (dVar != null) {
                    size = dVar.F.d();
                }
                if (i2 != null) {
                    i = this.i;
                    size = -size;
                    i.l.add(i2);
                    i.f = size;
                    i2.k.add(i);
                }
            } else {
                b.g.b.h.c cVar3 = dVar.E;
                cVar = dVar2.G;
                f i3 = i(cVar3, 1);
                int d2 = cVar3.d();
                m = m();
                if (m != null) {
                    d2 = m.E.d();
                }
                if (i3 != null) {
                    fVar = this.h;
                    fVar.l.add(i3);
                    fVar.f = d2;
                    i3.k.add(fVar);
                }
                i2 = i(cVar, 1);
                size = cVar.d();
                dVar = n();
                if (dVar != null) {
                    size = dVar.G.d();
                }
                if (i2 != null) {
                    i = this.i;
                    size = -size;
                    i.l.add(i2);
                    i.f = size;
                    i2.k.add(i);
                }
            }
            this.h.a = this;
            this.i.a = this;
        }
    }

    public void e() {
        for (int i = 0; i < this.k.size(); i++) {
            ((o) this.k.get(i)).e();
        }
    }

    public void f() {
        this.c = null;
        Iterator it = this.k.iterator();
        while (it.hasNext()) {
            ((o) it.next()).f();
        }
    }

    public long j() {
        long j = 0;
        for (int i = 0; i < this.k.size(); i++) {
            o oVar = (o) this.k.get(i);
            j = ((long) oVar.i.f) + (oVar.j() + (j + ((long) oVar.h.f)));
        }
        return j;
    }

    public boolean k() {
        int size = this.k.size();
        for (int i = 0; i < size; i++) {
            if (!((o) this.k.get(i)).k()) {
                return false;
            }
        }
        return true;
    }

    public final d m() {
        for (int i = 0; i < this.k.size(); i++) {
            d dVar = ((o) this.k.get(i)).b;
            if (dVar.c0 != 8) {
                return dVar;
            }
        }
        return null;
    }

    public final d n() {
        for (int size = this.k.size() - 1; size >= 0; size--) {
            d dVar = ((o) this.k.get(size)).b;
            if (dVar.c0 != 8) {
                return dVar;
            }
        }
        return null;
    }

    public String toString() {
        StringBuilder g = a.g("ChainRun ");
        g.append(this.f == 0 ? "horizontal : " : "vertical : ");
        String stringBuilder = g.toString();
        Iterator it = this.k.iterator();
        while (it.hasNext()) {
            o oVar = (o) it.next();
            stringBuilder = a.D(stringBuilder, "<");
            StringBuilder stringBuilder2 = new StringBuilder();
            stringBuilder2.append(stringBuilder);
            stringBuilder2.append(oVar);
            stringBuilder = a.D(stringBuilder2.toString(), "> ");
        }
        return stringBuilder;
    }
}
